﻿using Orchard.ContentManagement;

namespace AMC.SubstitutionCache.Models
{
    public class SubstitutionCacheSettingsPart : ContentPart
    {
        public bool DoTransformOnRedirect
        {
            get { return this.Retrieve(x => x.DoTransformOnRedirect, false); }
            set { this.Store(x => x.DoTransformOnRedirect, value); }
        }

        public string ExcludedShapeTypes
        {
            get { return this.Retrieve(x => x.ExcludedShapeTypes, "ContentZone,PlaceChildContent,LocalMenuItem,MenuItem,SubstitutionTokenWrapper"); }
            set { this.Store(x => x.ExcludedShapeTypes, value); }
        }

        public int DefaultCacheDurationSeconds
        {
            get { return this.Retrieve(x => x.DefaultCacheDurationSeconds, 900); }
            set { this.Store(x => x.DefaultCacheDurationSeconds, value); }
        }
    }
}